<!--A Design by W3layouts
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html>
<head>
<title>iQ Online Survey System| Signin </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link href="css/style.css" media="all" rel="stylesheet" type="text/css" />
</head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){

  var serverAddress = '127.0.0.1';
	
  $("#signinb").click(function(){
	  
	  var user_name= document.getElementById("username").value;
	var pass= document.getElementById("password").value;
	
    var request = $.ajax({
        url: "http://" + serverAddress + "/soen-6461-server/login/perform",
        type: "post",
        data : {
				username: user_name, 
				password : pass
			}
    });
	
	request.done(function (response, textStatus, jqXHR){
		//$('#response').text((JSON.stringify(response)));
		if(response.code==100)
		{
			window.location="user_page.html"
		}
		else if (response.code==-100)
		{
			//$('#response').text((JSON.stringify(response)));
		document.getElementById("response").innerHTML="check username or password";
		}
        
    });
	
  });
});
</script>
<body class="bg">
<div class="header-bg">
<div class="wrap">
	<div class="header">
		<div class="logo">
		  		<a href="index.html"><b><font color="#00FF33" size="+3">iQ Online Survey System</font></b> </a>
		 </div> </a>
		 </div>
	<div class="drp-dwn">
	 	<select onchange="window.location=this.options[this.selectedIndex].value">
			<option value="index.html">Home</option>
			<option value="signin.html">Signin</option>
			<option value="participate_in_survey.html">Participate In survey </option>
			<option value="about.html">About</option>
		</select>
	</div>
	 <div class="clear"></div>
	</div>
</div>
</div>
<div class="wrap">
	<div class="content">
<div class="section group">				
				<div class="col span_1_of_3">
					<div class="contact_info">
			    	 	<h3>Sign in</h3>
			    	 		<div class="map">
			    	 		  <form id="form1" method="post" action="">
			    	 		    <p>User Name 
			    	 		      <input type="text" name="username" id="username" />
		    	 		        </p>
			    	 		    <p>
			    	 		      <label for="password">Password&nbsp;&nbsp;</label>
			    	 		      <input name="password" type="password" id="password" />
			    	 		    </p>

			    	 		    <p>
			    	 		      <input name="signinb" type="button" id="signinb" value="Sign in"  onclick="#"  style="float: right" /></p></form>
                                  <div id="response">
                                  
                                  </div>
			    	 		
			    	 		  <small><a href="https://maps.google.co.in/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=Lighthouse+Point,+FL,+United+States&amp;aq=4&amp;oq=light&amp;sll=26.275636,-80.087265&amp;sspn=0.04941,0.104628&amp;ie=UTF8&amp;hq=&amp;hnear=Lighthouse+Point,+Broward,+Florida,+United+States&amp;t=m&amp;z=14&amp;ll=26.275636,-80.087265" style="color:#fff;;text-align:left;font-size:12px">View Larger Map</a></small>
			   		  </div>
      				</div>
				</div>
</div>
<p>
                            <a href="password_reset.html"><font size="-3" >Forgot password</font></a></p> 
                             <a href="user_registration.html"> <font size="-3" >Register new account</font></a></p>
</div>	

</div>
<div class="footer-bg">
<div class="wrap">
<div class="footer">
		<div class="f_grid1">
	<ul class="f_nav">
				<li class="active"><a href="index.html">Home</a></li>
				<li><a href="signin.html">Signin</a></li>
				<li><a href="participate_in_survey.html">Participate In survey</a></li>
				<li><a href="about.html">About</a></li>
			</ul>
			<div class="copy">
				<p class="w3-link">© All Rights Reserved | Design by&nbsp; <a href="http://w3layouts.com/"> W3Layouts</a></p>
			</div>
			<div class="clear"></div>
		</div>
</div>
</div>
</div>
</body>
</html>